const Controller = require('egg').Controller

class HouseTypeController extends Controller {
    async getHouseTypeById() {
        const { id } = this.ctx.request.body
        const ids = id.split(',')
        const houseType = []
        for (const id of ids) {
            const type = await this.service.house.houseType.getHouseTypeById(parseInt(id))
            if (type) {
                houseType.push(type)
            }
        }
        const res = {
            status: 0,
            houseType,
        }
        this.ctx.body = res
    }
}

module.exports = HouseTypeController
